#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 16 21:04:03 2019

@author: jili
"""
from jili.core.printlog import print
import redis
import pickle
pool = redis.ConnectionPool(host='127.0.0.1')
r = redis.Redis(connection_pool=pool)
def clearredis(head):
    isredis=True
    try:
        r.ping()
    except Exception as e:
        isredis=False
        print("redis is no running",e)
    if isredis:
        key=head+"*"
        for i in r.keys(key):
            print("del redis key/name",i)
            r.delete(i)
def dayclear():
    clearredis("trade_")
    clearredis("price_")
if __name__ == '__main__':
    dayclear()